// SmpWatcherDoc.cpp : implementation of the CSmpWatcherDoc class
//

#include "stdafx.h"

#include "csymbolfinder.h"

#include "SmpWatcher.h"

#include "SmpWatcherDoc.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif


// CSmpWatcherDoc

IMPLEMENT_DYNCREATE(CSmpWatcherDoc, CDocument)

BEGIN_MESSAGE_MAP(CSmpWatcherDoc, CDocument)
END_MESSAGE_MAP()


// CSmpWatcherDoc construction/destruction

CSmpWatcherDoc::CSmpWatcherDoc()
{
	// TODO: add one-time construction code here

}

CSmpWatcherDoc::~CSmpWatcherDoc()
{
}

BOOL CSmpWatcherDoc::OnNewDocument()
{
	if (!CDocument::OnNewDocument())
		return FALSE;

	// TODO: add reinitialization code here
	// (SDI documents will reuse this document)

	return TRUE;
}




// CSmpWatcherDoc serialization

void CSmpWatcherDoc::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		// TODO: add storing code here
	}
	else
	{
		// TODO: add loading code here
	}
}


// CSmpWatcherDoc diagnostics

#ifdef _DEBUG
void CSmpWatcherDoc::AssertValid() const
{
	CDocument::AssertValid();
}

void CSmpWatcherDoc::Dump(CDumpContext& dc) const
{
	CDocument::Dump(dc);
}
#endif //_DEBUG


// CSmpWatcherDoc commands


BOOL CSmpWatcherDoc::OnOpenDocument(LPCTSTR lpszPathName)
{
	if (!CDocument::OnOpenDocument(lpszPathName))
		return FALSE;

	// TODO:  Add your specialized creation code here

	USES_CONVERSION;
    if(!m_symbFinder.Init(lpszPathName))
    {
        CString msg(_T("Can't load Data From "));
        msg+=lpszPathName;
        MessageBox(NULL, msg.GetBuffer(), NULL, MB_OK );
        return FALSE;
    }

	return TRUE;
}
